
typedef struct _Area {
  void *start, *end;
} _Area; 


extern char _heap_start;
extern char _heap_end;
int main(const char *args);

_Area _heap = {
  .start = &_heap_start,
  .end = &_heap_end,
};


void _halt(int code) {
  // should not reach here
  while (1);
}

void _trm_init() {
  extern const char _start;
  const char *mainargs = &_start - 0x100000;
  int ret = main(mainargs);
  _halt(ret);
}
